# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=casefile
pkgver=1.0.1
pkgrel=9
groups=('blackarch' 'blackarch-forensic' 'blackarch-recon' 'blackarch-scanner')
pkgdesc="The little brother to Maltego without transforms, but combines graph and link analysis to examine links between manually added data to mind map your information"
arch=('any')
url='http://www.paterva.com/web6/products/casefile.php'
license=('GPL')
depends=('java-environment')
install='casefile.install'
source=("https://www.paterva.com/cf10/community/maltego-CF.${pkgver}_community-2012-03-14.zip"
        'http://www.paterva.com/web6/products/casefile_entities.mtz'
        'http://www.packetninjas.net/storage/socialnet/SocialNetEntityPackage.mtz'
        'http://ctas.paterva.com/TDSTransforms/GraphAPI/facebookObject.mtz'
        'http://ctas.paterva.com/TDSTransforms/BuiltWith/BuiltWithTechnology.mtz')
sha512sums=('948208af8076c73e4cbed1bd432c5f444afb9d01'
          '68fefa0172fe193a16f7ab8272de04c3e14e503d'
          'c7312bd60b18f5922ef48e3033e54d614ac33c38'
          '662d58c15ad265feba8f1ff0cde57f9773323d57'
          '832801f0e61d00d5a585d57bfa85998e33dfad69')

package() {
  cd v3.0

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"
  install -dm 755 "$pkgdir/usr/share/$pkgname/entities"

  cp -a --no-preserve=ownership bin etc ide maltego maltego-core-platform \
    maltego-ui platform "$pkgdir/usr/share/$pkgname"
  install -Dm644 "$srcdir/casefile_entities.mtz" \
    "$pkgdir/usr/share/$pkgname/entities/"
  install -Dm644 "$srcdir/SocialNetEntityPackage.mtz" \
    "$pkgdir/usr/share/$pkgname/entities/"
  install -Dm644 "$srcdir/facebookObject.mtz" \
    "$pkgdir/usr/share/$pkgname/entities/"
  install -Dm644 "$srcdir/BuiltWithTechnology.mtz" \
  "$pkgdir/usr/share/$pkgname/entities/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname/bin
exec ./maltego "\$@"
EOF
  chmod +x "$pkgdir/usr/bin/$pkgname"
}

